package com.gsk;
import com.gsk.dao.BookDao;
import com.gsk.service.BookService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.HashMap;
import java.util.Map;

public class MyApplicationContext {
    public static void main(String[] args) {
        Map<String,Object> map=new HashMap<>();
        ApplicationContext ctx=new ClassPathXmlApplicationContext("MiniApplicationContext.xml");

        BookService bookService=(BookService) ctx.getBean("bookService");
        BookDao bookDao=(BookDao) ctx.getBean("bookDao");
        map.put(BookService.class.descriptorString(),BookService.class);
        map.put(BookDao.class.descriptorString(), bookDao.hashCode());


        bookService.save();
        System.out.println(map);
    }
}
